$def with (path, error)

$var title: Permission Denied

<div id="contentHead">
    <h1>$_("Permission denied.")</h1>
</div>

<div id="contentBody">

<p>$error</p>


$if not ctx.user:
    $if path == "/books/add":
        <p>
            Only logged users are allowed to add records on Open Library.
            Please <a href="/account/login?redirect=$path">log in</a> to add a book.
        </p>
    $elif path.startswith("/books/") or path.startswith("/works/") or path.startswith("/authors/"):
        <p>
            Only logged users are allowed to modify records on Open Library.
            Please <a href="/account/login?redirect=$path">log in</a> to edit this page.
        </p>
    $else:
        <p>$:_('You may <a href="%s">log in</a> if you have the required permissions.', "/account/login?" + urlencode(dict(redirect=path)))</p>

</div>
